<%-- 
    Document   : report_form
    Created on : Jan 17, 2012, 5:20:05 PM
    Author     : haqqiem
--%>

<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<s:useActionBean beanclass="ipfms.stripes.util.ListUtil" var="list"/>

<script type="text/javascript">
    $(document).ready(function() {
        var data = (document.getElementById('rep')).value;
        if(data == ""){
            $("#btnSave").attr("disabled", "true");
        }
    })
    
    function reqField(id,data){
        if(data == ''){
            alert('This field is required!');
        }else{
            $("#btnSave").removeAttr("disabled");
        }
    }
    
</script>
<form:form beanclass="ipfms.stripes.maintenance.ReportFormActionBean">
    <s:messages/>
    <s:errors/><br>
    <div class="subtitle">

        <fieldset class="aras1">
            <legend>FAULTY REPORT</legend>
            <p></p>
            <div class="content">
            <p>
                <label class="label1">Property Name : </label>
                <s:select name="build_id" class="menu">
                    <s:options-collection collection="${actionBean.listOfBuilding}" label="buildingName" value="idBuilding"/>
                </s:select><s:submit name="searching" value="Search" class="btn"/>
            </p>
            <c:if test="${actionBean.flag}">
                <p>
                    <label  class="label1" >Address : </label>
                    ${actionBean.building.buildingAdd1}&nbsp;<br>
              
                    <label  class="label1">&nbsp;</label>
                    ${actionBean.building.buildingAdd2}&nbsp;<br>
                
                    <label  class="label1">&nbsp;</label>
                    ${actionBean.building.buildingAdd3}&nbsp;<br>
     
                    <label  class="label1">&nbsp;</label>
                    ${actionBean.building.buildingAdd4}&nbsp;
                </p>

                <p>
                    <label  class="label1">Classification :</label>
                    <s:select name="code_class" class="menu">
                        <s:options-collection collection="${list.senaraiKlasifikasi}" label="name" value="code"/>
                    </s:select>
                </p>

                <p>
                    <label  class="label1"><em style="font-style: italic;color: red;">*</em> Details :</label>
                    <s:textarea name="report" style="height:100px;width:50%" id="rep" onblur="reqField('rep',this.value)"/>
                </p>

                <c:if test="${actionBean.context.currentUser.kodJenisPengguna.code eq '06'}">
                    <p>
                        <label  class="label1">Category :</label>
                        <s:select name="code_maintenance" class="menu">
                            <s:options-collection collection="${list.senaraiMaintenance}" label="name" value="code"/>
                        </s:select>
                    </p>

                    <p>
                        <label  class="label1">Feedback :</label>
                        <s:textarea name="feedback" style="height:100px;width:50%"/>
                    </p>
                </c:if>

                <p>
                    <label  class="label1">&nbsp;</label>
                    <s:submit name="save" value="Save" class="btn" id="btnSave"/>
                </p>
            </c:if>
                <br></div>
        </fieldset>
    </div>
</form:form>